import request from '@/utils/request'

// 查询活动列表列表
export function listActivity(body, query) {
  return request({
    url: '/api/activity/list',
    method: 'POST',
    data: body,
    params: query
  })
}

// 查询活动列表详细
export function getActivity(pkId) {
  return request({
    url: '/api/activity/' + pkId,
    method: 'get'
  })
}

// 新增活动列表
export function addActivity(data) {
  return request({
    url: '/api/activity',
    method: 'post',
    data: data
  })
}

// 修改活动列表
export function updateActivity(data) {
  return request({
    url: '/api/activity',
    method: 'put',
    data: data
  })
}

// 删除活动列表
export function delActivity(pkId) {
  console.log(pkId)
  return request({
    url: '/api/activity/' + pkId,
    method: 'delete'
  })
}

// 删除岗位列表
export function deljob(jobId) {
  console.log(jobId)
  return request({
    url: '/api/activity/job',
    method: 'delete',
    data: jobId
  })
}

// 上传图片
export function uploadPic(data, params) {
  return request({
    url: '/file/upload/image',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    params,
    data
  })
}

// 审核通过
export function pass(data) {
  return request({
    url: '/api/activity/pass',
    method: 'post',
    params: {
      activityId: data
    }
  })
}

// 审核拒绝
export function deny(data) {
  return request({
    url: '/api/activity/deny',
    method: 'post',
    params: {
      activityId: data
    }
  })
}

// 查询活动服务详细
export function activityServicelist(data) {
  console.log(data)
  return request({
    url: '/api/activityService/list',
    method: 'get',
    params: data
  })
}

// 新增活动服务列表
export function addactivityService(data) {
  return request({
    url: '/api/activityService',
    method: 'post',
    data: data
  })
}

// 修改活动服务列表
export function updateactivityService(data) {
  return request({
    url: '/api/activityService',
    method: 'put',
    data: data
  })
}

// 删除活动列表
export function delActivityService(pkId) {
  console.log(pkId)
  return request({
    url: '/api/activityService/delete/' + pkId,
    method: 'delete'
  })
}

// 查询显示活动服务详细
export function activitynormalList(data) {
  return request({
    url: '/api/activityService/normalList',
    method: 'get',
    params: data
  })
}
// 新增补录列表
export function enterActivity(data) {
  return request({
    url: '/api/activity/enter',
    method: 'post',
    data: data
  })
}
